#include <iostream>
using namespace std;

int main() {
	int max, min, sum;
	max = -9999999;
	min = 99999999;
	sum = 0;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int temp;
		cin >> temp;
		if (temp < min)
			min = temp;
		if (temp > max)
			max = temp;
		sum += temp;
	}
	cout << max << endl << min << endl << sum;
}